package com.hns.tool.export.excel.excelTemplate;

import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * 导出实体类
 * @author:Fisher
 * @email:zhuangcaijin@126.com
 * @version Revision 2.0.0
 */
public class ExportExcelTempEntity {

	/** 
	 * 要导出的数据源 
	 */
	private List dataSource;

	/** 
	 * 标题对象 
	 */
	private Object title;

	/** 
	 * 模板名 
	 */
	private String templateName;

	/** 
	 * 显示给用户文件名 
	 */
	private String showName;

	/**
	 * 构造
	 * @email:zhuangcaijin@126.com
	 */
	public ExportExcelTempEntity() {
		super();
	}

	/**
	 * 构造
	 * @param dataSource 要导出的数据源
	 * @param templateName excel模板名
	 * @param showName 显示给用户文件名
	 * @email:zhuangcaijin@126.com
	 */
	public ExportExcelTempEntity(List dataSource, String templateName, String showName) {
		super();
		this.dataSource = dataSource;
		this.templateName = templateName;
		this.showName = showName;
	}

	/**
	 * 构造
	 * @param dataSource 要导出的数据源
	 * @param title 标题对象
	 * @param templateName excel模板名
	 * @param showName 显示给用户文件名
	 * @email:zhuangcaijin@126.com
	 */
	public ExportExcelTempEntity(List dataSource, Object title, String templateName, String showName) {
		super();
		this.dataSource = dataSource;
		this.title = title;
		this.templateName = templateName;
		this.showName = showName;
	}

	/**
	 * 构造
	 * @param dataSource 要导出的数据源
	 * @param title 标题对象
	 * @param tempName excel模板名
	 * @email:zhuangcaijin@126.com
	 */
	public ExportExcelTempEntity(List dataSource, Object title, String tempName) {
		super();
		this.dataSource = dataSource;
		this.title = title;
		this.templateName = tempName;
	}

	public List getDataSource() {
		return dataSource;
	}

	public ExportExcelTempEntity setDataSource(List dataSource) {
		this.dataSource = dataSource;
		return this;
	}

	public Object getTitle() {
		return title;
	}

	public ExportExcelTempEntity setTitle(Object title) {
		this.title = title;
		return this;
	}

	public String getTempName() {
		return templateName != null ? templateName.trim() : templateName;
	}

	public ExportExcelTempEntity setTempName(String templateName) {
		this.templateName = templateName;
		return this;
	}

	public String getTemplateName() {
		return templateName != null ? templateName.trim() : templateName;
	}

	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}

	public String getShowName() {
		try {
			return showName != null ? new String(showName.getBytes("gbk"), "ISO8859-1") : showName;
		} catch (UnsupportedEncodingException e) {
		}
		return null;
	}

	public void setShowName(String showName) {
		this.showName = showName;
	}

}
